import java.awt.*;

public class MyText implements Shapes{
    private String text;
    private int x;
    private int y;
    private Color color;
    public MyText(){}
    public MyText(int x,int y, String text,Color color){
        this.x=x;
        this.y=y;
        this.text=text;
        this.color=color;
    }

    @Override
    public void draw(Graphics g) {
        g.setColor(color);
        g.drawString(text,x,y);
    }

    @Override
    public Shapes random() {
        System.out.println("该方法暂时不可用。");
        return null;
    }
}
